/*********************
* Author:Dzlua
* QQ:505544956
* time:2016/12/03
*/
#ifndef __EDUI_LUACONTAINER_H__
#define __EDUI_LUACONTAINER_H__

#include "../../container/Container.h"
#include "../controls/LuaControl.h"

#ifdef EDUI_USE_LUAPLUS

EDUI_NAMESPACE_BEGIN

class LuaContainer : public LuaControl
{
public:
    LuaContainer(Container* container);
    virtual ~LuaContainer();
    static void* GetInterface(void* data);
    virtual void Release();
    static void Register(LuaState *L);
public:
    int Add(LuaState *L);
    int AddAt(LuaState *L);
    int Get(LuaState *L);
    int GetByIndex(LuaState *L);
    int Remove(LuaState *L);
    void RemoveByIndex(size_t index);
    void Clear();
    size_t Count();

    bool SetInset(int l, int t, int r, int b);
    int GetInset(LuaState *L);
    void SetChildPadding(int paddingX, int paddingY);
    int GetChildPadding(LuaState *L);

    int FindControl(LuaState *L);
    int FindControlByTabID(LuaState *L);
};

EDUI_NAMESPACE_END

#endif
#endif